package mvp.demo.P;


import java.lang.ref.WeakReference;
import java.util.List;

import mvp.demo.M.IModel;
import mvp.demo.M.MainModel;
import mvp.demo.V.IView;

/**
 * Created by cjz on 2018/7/20.
 */
public abstract class BasePresenter implements IPresenter {


    WeakReference<IView> viewRef;
    IModel model;

    public BasePresenter() {
        attachModel();
    }

    @Override
    public void attachView(IView view) {
        viewRef = new WeakReference<>(view);
    }

    @Override
    public void detachView(IView view) {
        viewRef.clear();
    }


}
